home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / e / epp_v1_1.lha / EPP / PModules / sysTime.e < prev    next >
Text File  |  1993-06-26  |  1KB  |  43 lines

  1. OPT TURBO
  2.  
  3. /*---------------------------------------------------------------------*/
  4. /* Module systemTimeStr() function.  This is necessary for KS1.3 users */
  5. /* since we can't use the utilities.library, nor the DatetoStr()       */
  6. /* function of the newer OS.                                           */
  7. /*---------------------------------------------------------------------*/
  8.  
  9. MODULE 'dos/datetime', 'dos/dos'
  10. PMODULE 'PMODULES:itoa'
  11.  
  12. PROC buildTimeStr (theString, hour, minute, second)
  13.   DEF tempStr [2] : STRING
  14.   SetStr (theString, 0)
  15.   VOID itoa (tempStr, hour)
  16.   IF hour < 10 THEN StrAdd (theString, '0', ALL)
  17.   StrAdd (theString, tempStr, ALL)
  18.   StrAdd (theString, ':', ALL)
  19.  
  20.   VOID itoa (tempStr, minute)
  21.   IF minute < 10 THEN StrAdd (theString, '0', ALL)
  22.   StrAdd (theString, tempStr, ALL)
  23.   StrAdd (theString, ':', ALL)
  24.  
  25.   VOID itoa (tempStr, second)
  26.   IF second < 10 THEN StrAdd (theString, '0', ALL)
  27.   StrAdd (theString, tempStr, ALL)
  28. ENDPROC  theString
  29.   /* buildTimeStr */
  30.  
  31.  
  32. PROC systemTimeStr (theString)
  33.   DEF ds : PTR TO datestamp,
  34.       hour, minute, second
  35.   ds := DateStamp (New (SIZEOF datestamp))
  36.   hour := ds.minute / 60
  37.   minute := ds.minute - (hour * 60)
  38.   second := ds.tick / 50
  39.   Dispose (ds)
  40. ENDPROC  buildTimeStr (theString, hour, minute, second)
  41.   /* systemTimeStr */
  42.  
  43.